package day15.problem3;

//拓扑排序
//https://www.nowcoder.com/practice/88f7e156ca7d43a1a535f619cd3f495c?tpId=308&tqId=40470&ru=/exam/oj

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] values = br.readLine().split(" ");
        int n = Integer.parseInt(values[0]);
        int m = Integer.parseInt(values[1]);
        int[] edg = new int[n+1];
        Map<Integer, List<Integer>> map = new HashMap<>();
        for(int i = 0; i<n; i++) {
            map.put(i+1, new ArrayList<>());
        }
        for(int i = 0; i<m; i++) {
            values = br.readLine().split(" ");
            int a = Integer.parseInt(values[0]);
            int b = Integer.parseInt(values[1]); //a->b
            edg[b]++;
            map.get(a).add(b);
        }
//        System.out.println(map);
        // System.out.println(Arrays.toString(edg));
        Queue<Integer> queue = new LinkedList<>();
        for(int x : map.keySet()) {
            if(edg[x] == 0) {
//                System.out.println(x);
                queue.add(x);
            }
        }
        List<Integer> list = new ArrayList<>();
        while(!queue.isEmpty()) {
            int t = queue.poll();
            list.add(t);
            for(int x : map.get(t)) {
                edg[x]--;
                if(edg[x] == 0) {
                    queue.add(x);
                }
            }
        }
        for(int x : map.keySet()) {
            if(edg[x] > 0) {
                System.out.println(-1);
                return;
            }
        }
        for(int i = 0; i<list.size(); i++) {
            System.out.print(list.get(i));
            if(i < list.size()-1) {
                System.out.print(" ");
            }
        }
    }
}